
package com.phevos.usercenter.client;

import javax.servlet.http.HttpServlet;

import net.sf.ehcache.CacheManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class InitCache extends HttpServlet
{
    private static final long serialVersionUID = 8616933426854853567L;
    
    private static Logger logger = LoggerFactory.getLogger(InitCache.class.getName());

    public void init()
    {
        CacheManager cacheManager = CacheManager.getInstance();
        if (cacheManager == null)
        {
            logger.error("CacheManager is null");
        }
        String compute = this.getInitParameter("computeObjFunction");
        if (compute != null && compute.equals("true"))
        {
            ComputeThread thread = new ComputeThread();
            thread.start();
        }
    }
}
